.TH std::experimental::ranges::value_type 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::experimental::ranges::value_type \- std::experimental::ranges::value_type

.SH Synopsis
   Defined in header <experimental/ranges/iterator>
   template< class I >                                          \fB(1)\fP
   struct value_type {};
   template< class T >                                          \fB(2)\fP
   struct value_type<T*>;
   template< class I >

       requires std::is_array<I>::value                         \fB(3)\fP

   struct value_type<I> : value_type<std::decay_t<I>> {};
   template< class T >                                          \fB(4)\fP
   struct value_type<const T> : value_type<std::decay_t<T>> {};
   template< class T >

       requires requires { typename T::value_type; }            \fB(5)\fP

   struct value_type<T>;
   template< class T >

       requires requires { typename T::element_type; }          \fB(6)\fP

   struct value_type<T>;

   Computes the associated value type of the type I, if any. Users may specialize
   value_type for a program-defined type.

   1) Primary template is an empty struct.
   2) Specialization for pointers. If T is an object type, provides a member type type
   equal to std::remove_cv_t<T>. Otherwise, there is no member type.
   3) Specialization for array types.
   4) Specialization for const-qualified types.
   5) Specialization for types that define a public and accessible member type
   value_type. If T::value_type is an object type, provides a member type type equal to
   T::value_type. Otherwise, there is no member type.
   6) Specialization for types that define a public and accessible member type
   element_type (e.g., std::shared_ptr). If T::element_type is an object type, provides
   a member type type equal to std::remove_cv_t<typename T::element_type>. Otherwise,
   there is no member type.

.SH Notes

   If a type contains both a value_type member and a element_type member, then the
   specializations \fB(5)\fP and \fB(6)\fP are ambiguous.

   value_type is intended for use with Readable types such as iterators. It is not
   intended for use with ranges.

.SH Example

    This section is incomplete
    Reason: no example

.SH See also

   Readable        specifies that a type is readable by applying operator *
                   (concept)
                   compatibility traits class that collects an iterator’s associated
   iterator_traits types
                   (alias template)

.SH Category:
     * Todo no example
